﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Auth_TiposAtivos : System.Web.UI.UserControl, IViewStatePersist
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Page_PreRender(object sender, EventArgs e)
    {
        this.lvCampoTipoAtivo.Visible = this.lvTipoAtivo.SelectedIndex != -1;
    }
    protected void lvCampoTipoAtivo_ItemInserting(object sender, ListViewInsertEventArgs e)
    {
        e.Values["TipoAtivoId"] = lvTipoAtivo.SelectedValue;
        DropDownList CampoIdDropDown = e.Item.FindControl("CampoIdDropDown") as DropDownList;
        e.Values["CampoId"] = CampoIdDropDown.SelectedValue;
    }
    protected void lvTipoAtivo_ItemEditing(object sender, ListViewEditEventArgs e)
    {
        lvTipoAtivo.SelectedIndex = e.NewEditIndex;
    }
    protected void lvTipoAtivo_SelectedIndexChanged(object sender, EventArgs e)
    {
       
    }
    protected void lvTipoAtivo_ItemCanceling(object sender, ListViewCancelEventArgs e)
    {
        if (e.CancelMode == ListViewCancelMode.CancelingEdit)
        {
            this.lvTipoAtivo.SelectedIndex = -1;
        }
    }
	protected void lvTipoAtivo_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
	{
		if (e.NewSelectedIndex != this.lvTipoAtivo.EditIndex)
		{
			lvTipoAtivo.EditIndex = -1;
		}
	}

	#region IViewStatePersist Members

	public new object SaveViewState()
	{
		return base.SaveViewState();
	}

	public new void LoadViewState(object savedState)
	{
		base.LoadViewState(savedState);
	}

	#endregion
}
